package hk.m4s.lr.repair.test.ui.goods;

import android.content.Context;
import android.os.Bundle;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

import framework.common.baseui.UeBaseActivity;
import hk.m4s.lr.repair.test.R;
import hk.m4s.lr.repair.test.model.FlashSaleModel;
import hk.m4s.lr.repair.test.ui.adapter.FlashSaleListAdapter;
import hk.m4s.lr.repair.test.views.listview.VListView;

/**
 * Created by qi.wang on 2017/12/4.
 * 限时购
 */

public class FlashSaleActivity extends UeBaseActivity{
    private Context mContext;
    private VListView vListView;
    private FlashSaleListAdapter adapter;
    private List<FlashSaleModel>flashSaleModelList=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        baseSetContentView(R.layout.acyivity_flashsale_list);
        hiddenFooter();
        showGoBackBtn();
        setTitleText("限时购");
        getCarBtn().setVisibility(View.VISIBLE);
        mContext=this;
        vListView=(VListView) findViewById(R.id.vlist);
        adapter=new FlashSaleListAdapter(mContext,flashSaleModelList);
        vListView.setAdapter(adapter);
        showInfo();
    }
    public void showInfo(){
        for(int i=0;i<10;i++){
            FlashSaleModel model=new FlashSaleModel();
            model.setGoodsName("职业套装欧美条纹西服");
            model.setGoodsOldPrice("220");
            model.setGoodsPrice("118");
            model.setGoodsSale("12");
            flashSaleModelList.add(model);
        }
        adapter.notifyDataSetChanged();
    }
}
